//
//  URL.swift
//  CMKit
//
//  Created by travel on 2016/12/16.
//  Copyright © 2016年 covermedia. All rights reserved.
//

import Foundation


public extension URL {
    /// 返回url qury查询参数dict
    public var queryDict:[String:String] {
        var query = [String:String]()
        for item in URLComponents.init(url: self, resolvingAgainstBaseURL: false)?.queryItems ?? [] {
            query[item.name] = item.value
        }
        return query
    }
}
